#include <mysql/mysql.h>
#include <stdio.h>

int main(void){
    MYSQL *conn = NULL;
    char *host = "localhost";
    char *user = "root";
    char *passwd = "185463";
    char *db = "project";

    conn = mysql_init(NULL);

    if(mysql_real_connect(conn, host, user, 
        passwd, db, 0, NULL, 0) == NULL){
        printf("error:%s\n", mysql_error(conn));
        return EXIT_FAILURE;
    }
    printf("连接成功！\n");
}

